-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename working_dir
to workdir
for consistency
#332
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aparcar The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Currently `podman-py` uses all three versions of `work_dir`, `working_dir` and `workdir` (not to mention `WorkingDir`). This commit tries to unify the parameter usage by allowing `workdir` for container `create` or `run`. For backwards compatibility `working_dir` still works but a deprecation warning is added. Since upstream Podman uses a variety of *workdir* versions the `podman-py` codebase can't be simplified further. Fix: containers#330 Signed-off-by: Paul Spooren <[email protected]>
LGTM |
Changes LGTM |
if "working_dir" in args: | ||
warnings.warn("working_dir is deprecated, use workdir instead", PendingDeprecationWarning) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the warning. The library is intended to be a super set of the Docker SDK which uses working_dir
as their parameter. I have no issue with workdir being added as an "alias".
@@ -287,7 +288,7 @@ def create( | |||
} | |||
|
|||
volumes_from (List[str]): List of container names or IDs to get volumes from. | |||
working_dir (str): Path to the working directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please retain this comment, see below.
self.client.containers.create( | ||
self.alpine_image, working_dir="/tmp", command=["/bin/ls", "-l", "/"] | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for including a test, but it will need to be adjusted to verify workdir
works as expected.
@aparcar still working on this? |
@umohnani8 Could you take this over and get it merged? |
Currently
podman-py
uses all three versions ofwork_dir
,working_dir
andworkdir
(not to mentionWorkingDir
).This commit tries to unify the parameter usage by allowing
workdir
for containercreate
orrun
. For backwards compatibilityworking_dir
still works but a deprecation warning is added.Since upstream Podman uses a variety of workdir versions the
podman-py
codebase can't be simplified further.Fix: #330